﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="PostPage.aspx.cs" Inherits="MAA.Presentation.PRL.Trading.PostPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/PostPage.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="PostInfo">
        <h2>
            <asp:Label ID="langPostInformation" runat="server" Text="<%$Resources:language, langPostInformation%>"></asp:Label></h2>
        <br />
        <div class="Info" style="display: inline-block; float: left;">
            <label style="margin-left: 150px;">
                <asp:Label ID="langRiceType" runat="server" Text="<%$Resources:language, langRiceType%>"></asp:Label></label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langAmount" runat="server" Text="<%$Resources:language, langAmount%>"></asp:Label></label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langPostTradedAmount" runat="server" Text="<%$Resources:language, langPostTradedAmount%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langUnitPrice" runat="server" Text="<%$Resources:language, langUnitPrice%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langPostPerPrice" runat="server" Text="<%$Resources:language, langPostPerPrice%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langAddress" runat="server" Text="<%$Resources:language, langAddress%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langProvince" runat="server" Text="<%$Resources:language, langAddress%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langDateBuy" runat="server" Text="<%$Resources:language, langDateBuy%>"></asp:Label>:</label><br />
            <br />
            <label style="margin-left: 150px;">
                <asp:Label ID="langStatus" runat="server" Text="<%$Resources:language, langStatus%>"></asp:Label>:</label><br />
            <br />
        </div>
        <div class="enter" style="display: inline-block; margin-left: 20px;">
            <asp:Label runat="server" ID="lblRiceType">lblRiceType</asp:Label><br />
            <br />
            <asp:Label runat="server" ID="lblAmount"></asp:Label>kg<br />
            <br />
            <asp:Label runat="server" ID="lblTradedAmount"></asp:Label>kg<br />
            <br />
            <asp:Label runat="server" ID="lblPrice"></asp:Label>vnd<br />
            <br />
            <asp:Label runat="server" ID="lblPerPrice"></asp:Label>%<br />
            <br />
            <asp:Label runat="server" ID="lblAddress"></asp:Label><br />
            <br />
            <asp:Label runat="server" ID="lblProvince"></asp:Label><br />
            <br />
            <asp:Label runat="server" ID="lblCreateDate"></asp:Label><br />
            <br />
            <asp:Label runat="server" ID="lblStatus"></asp:Label><br />
            <br />
        </div>
        <asp:Button Style="float: right;" runat="server" ID="btnCancelTrade" Text="<%$Resources:language, langCancelOrder%>"
            OnClientClick="return confirm('<%$Resources:language, langConfirmCancelTransaction%>')"
            OnClick="btnCancelTrade_Click" />
    </div>
    <div class="ListBuyer">
        <div style="display: inline-block; cursor: pointer;" id="listOrderNow">
            <h2>
                <asp:Label ID="langListOrderNow" runat="server" Text="<%$Resources:language, langListOrderNow%>"></asp:Label>
                <asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="~/WebData/Image/WebImage/ShowMore.png">
                </asp:ImageMap>
            </h2>
        </div>
        <br />
        <asp:Label runat="server" ID="lblOrderListMess" ForeColor="Red"></asp:Label>
        <div Style="display: none;" class="dgvBuyer">
            <asp:GridView  ID="dgvOrderBuyer" runat="server" CellPadding="4"
                ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" BorderColor="#A11DC2"
                BorderStyle="Solid" BorderWidth="1px" OnRowCommand="dgvOrderBuyer_RowCommand"
                Width="100%" OnRowDataBound="dgvOrderBuyer_RowDataBound">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField HeaderText="Buyer ID" DataField="UserID" />
                    <asp:BoundField DataField="Name" HeaderText="Buyer name">
                        <HeaderStyle HorizontalAlign="Left" />
                        <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Buyer phone" DataField="Phone">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Buyer email" DataField="Email">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Buyer address" DataField="Address">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Buyer province" DataField="Province">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Order ID" DataField="OrderID">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Amount" HeaderText="Order amount">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Price" HeaderText="Order price">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Order status" DataField="StatusName">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="" ShowHeader="False" Visible="False">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnAccept" runat="server" ToolTip="Đồng ý" Visible="False" CommandName="AcceptOrder"
                                CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" ImageUrl="~/WebData/Image/WebImage/OK.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="" ShowHeader="False" Visible="False">
                        <ItemTemplate>
                            <asp:ImageButton ID="btnReject" runat="server" ToolTip="Từ chối" Visible="False"
                                CommandName="RejectOrder" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
                                ImageUrl="~/WebData/Image/WebImage/Cancel.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#7C6F57" />
                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#d2bdf2" Height="30px" />
                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F8FAFA" />
                <SortedAscendingHeaderStyle BackColor="#246B61" />
                <SortedDescendingCellStyle BackColor="#D4DFE1" />
                <SortedDescendingHeaderStyle BackColor="#15524A" />
            </asp:GridView>
        </div>
    </div>
    <script type="text/javascript">
        var checkTab = true;
        $('#listOrderNow').bind('click', function (e) {
            if (checkTab) {
                $('.dgvBuyer').css('display', 'block');
                checkTab = false;
            }
            else {
                $('.dgvBuyer').css('display', 'none');
                checkTab = true;
            }
        });
    </script>
</asp:Content>
